/*
 * Copyright (c) 2006, 2022, webrx.cn All rights reserved.
 *
 */
package cn.webrx;

/**
 * <p>Project: javase2203 - Ex
 * <p>Powered by webrx On 2022-07-14 17:21:25
 * <p>Created by IntelliJ IDEA
 *
 * @author webrx [webrx@126.com]
 * @version 1.0
 * @since 17
 */
public class Ex {
    public static void main(String[] args) {
        int i = 0;
        for (int a = 0; a <= 100/5; a++) {
            for (int b = 0; b <= 100/3; b++) {
                for (int c = 0; c <= 100; c++) {
                    ++i;
                    if((a+b+c) == 100 && (a*5+b*3+c/3)==100 && c%3==0){
                        System.out.printf("公鸡：%d只，母鸡：%d只，小鸡：%d只。%n",a,b,c);
                        break;
                    }
                }
            }
        }
        System.out.println();
        System.out.printf("%d%n",i);
    }
}
